GBML manual / Core

profile_name

The name of a phase, like "step" or "default sprites". An empty string if there is no such phase, or the profiler is off.

Works differently on Game Boy - The Game Boy has no frame profiler: profile_enabled says false and every profile number reads 0.

Works differently on Game Boy Color - The Game Boy Color has no frame profiler: profile_enabled says false and every profile number reads 0.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

profile_name(phase) -> string

Arguments

NameType
phaseint

Returns

string

Description

The name of a phase, such as "step", "motion" or "default sprites". Give it a number from 1 to profile_phases(). Number 0 is PROFILE_TOTAL and its name is "total". Any other number, or a build with the profiler off, gives an empty string.

Example

draw_text(4, 4, profile_name(PROFILE_TOTAL));

Draws the word total.

Cost

A name is at most 16 characters. If your project's string size is smaller than that, the name is cut short. It is never an error.

On the GBA

Names are at most 16 characters. A name longer than your project's string size is cut short, never a crash.

See also: profile_phasesprofile_percent